#define _CRT_SECURE_NO_WARNINGS 1

#include <string>
using namespace std;

class Solution {
public:
    string modifyString(string s) {
        int n = s.size();
        for (int i = 0; i < n; ++i)
        {
            if (s[i] == '?')
            {
                char tmp = 'a';
                while (1)
                {
                    if ((i == 0 || tmp != s[i - 1]) && (i == n - 1 || tmp != s[i + 1])) break;
                    ++tmp;
                }
                s[i] = tmp;
            }
        }
        return s;
    }
};